<?php use app\models\User; ?>
<html>
<head>
<link rel="stylesheet"
	href="//cdn.staticfile.org/font-awesome/4.7.0/css/font-awesome.min.css" />
<link rel="stylesheet" href="/static/css/main.css?ver=20190421" />
<link rel="stylesheet" href="/static/css/index.css?ver=20190421" />
<link rel="stylesheet" href="/static/css/form.css?ver=20190421" />
<link rel="stylesheet" href="/static/css/problem.css?ver=20190421" />
<link rel="stylesheet" href="/static/css/record.css?ver=20190421" />
<link rel="stylesheet" href="/static/css/prism.css?ver=20190421" />
<script src="/static/js/node_modules/marked/lib/marked.js?ver=20190421"></script>
<script
	src="/static/js/node_modules/commonmark/dist/commonmark.js?ver=20190421"></script>
<script
	src="//cdn.bootcss.com/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/x-mathjax-config">
    MathJax.Hub.Config({
        tex2jax: {
            inlineMath: [ ['$','$'] ],
            displayMath: [ ['$$','$$'] ]
        }
    });
    </script>
<link rel="dns-prefetch" href="//cdn.mathjax.org" />
<script src="//cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
<script src="/static/js/main.js?ver=20190421"></script>
<script src="/static/js/index.js?ver=20190421"></script>
<script src="/static/js/page.js?ver=20190421"></script>
<script
	src="/static/js/node_modules/clipboard/dist/clipboard.min.js?ver=20190421"></script>
<script src="/static/js/prism.js?ver=20190421"></script>
<script src="/static/js/user.js?ver=201904281"></script>
<meta name="description" content="YALI-501" />
<meta name="keywords" content="YALI-501" />
<meta charset="UTF-8" />
<title><?php echo @$title . ' - ' . SITE['name'] ?></title>
</head>
<body>
	<div class="nav">
		<div class="nav-container">
			<div class="nav-side"></div>
			<div class="nav-element">
				<a href="/"><?php echo SITE['name'] ?></a>
			</div>
			<div class="nav-element">
				<a href="/problem"><i class="fa fa-list fa-fw"></i> 题目</a>
			</div>
			<div class="nav-element">
				<a href="/record"><i class="fa fa-bar-chart fa-fw"></i> 记录</a>
			</div>
			<div class="nav-divide"></div>
        <?php
        if (User::isLogin()) {
            $user = User::getUser();
            echo '<div class="nav-element"><a href="/user/?id=' . $user['id'] . '"><i class="fa fa-user-circle fa-fw"></i> ' . $user['nickname'] . '</a></div>';
            if ($user['group'] == 99)
                echo '<div class="nav-element"><a href="/admin/"><i class="fa fa-cogs fa-fw"></i> 管理</a></div>';
            echo '<div class="nav-element"><a href="/user/logout/"><i class="fa fa-sign-out fa-fw"></i> 注销</a></div>';
        } else {
            echo '<div class="nav-element"><a href="/user/login/"><i class="fa fa-sign-in fa-fw"></i> 登录</a></div>';
            echo '<div class="nav-element"><a href="/user/register/"><i class="fa fa-user-plus fa-fw"></i> 注册</a></div>';
        }
        ?>
		<div class="nav-side"></div>
		</div>
	</div>
	<header>
	</header>
	<!-- <?php if (isset($title)):?><h1><?php echo $title?></h1><?php endif ?> -->